package com.hs.controller;

import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author lxz
 * @Name
 * @Date 2024/12/17 17:40
 */
@RestController
@RequestMapping("/home")
public class HomeController extends BaseController{

    @GetMapping("getTableData")
    public Object getTableData(){
            String s = "{\n" +
                    "                tableData:[\n" +
                    "                    {\n" +
                    "                        name: \"java\",\n" +
                    "                        today: 300,\n" +
                    "                        month: 200,\n" +
                    "                        total: 500,\n" +
                    "                      },\n" +
                    "                      {\n" +
                    "                        name: \"Python\",\n" +
                    "                        today: 300,\n" +
                    "                        month: 200,\n" +
                    "                        total: 500,\n" +
                    "                      }\n" +
                    "                      ,\n" +
                    "                      {\n" +
                    "                        name: \"C++\",\n" +
                    "                        today: 300,\n" +
                    "                        month: 200,\n" +
                    "                        total: 500,\n" +
                    "                      }\n" +
                    "                ]\n" +
                    "            }";
        return renderSuccess(JSONObject.parse(s));
    }
    @GetMapping("getCountData")
    public Object getCountData(){
        String s = "{\n" +
                "              countData:[\n" +
                "                {\n" +
                "                  name: '本月支付订单',\n" +
                "                  value: 1234,\n" +
                "                  icon: 'SuccessFilled',\n" +
                "                  color: 'blue'\n" +
                "                  \n" +
                "                },\n" +
                "                {\n" +
                "                  name: '本月支付订单',\n" +
                "                  value: 1234,\n" +
                "                  icon: 'SuccessFilled',\n" +
                "                  color: '#545c64'\n" +
                "                },\n" +
                "                {\n" +
                "                  name: '本月支付订单',\n" +
                "                  value: 1234,\n" +
                "                  icon: 'SuccessFilled',\n" +
                "                  color: '#545c64'\n" +
                "                },\n" +
                "                {\n" +
                "                  name: '本月支付订单',\n" +
                "                  value: 1234,\n" +
                "                  icon: 'SuccessFilled',\n" +
                "                  color: '#545c64'\n" +
                "                },\n" +
                "                {\n" +
                "                  name: '本月支付订单',\n" +
                "                  value: 1234,\n" +
                "                  icon: 'SuccessFilled',\n" +
                "                  color: '#545c64'\n" +
                "                },\n" +
                "                {\n" +
                "                  name: '本月支付订单',\n" +
                "                  value: 1234,\n" +
                "                  icon: 'SuccessFilled',\n" +
                "                  color: '#545c64'\n" +
                "                },\n" +
                "              ]\n" +
                "          }";
        return renderSuccess(JSONObject.parse(s));
    }
}
